<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:tw="http://twork.com"
	xmlns:p="http://primefaces.org/ui">


<ui:composition>

<h:panelGrid columns="2">
		<h:outputLabel value="#{appMsg['driver.firstname']}" />
		<p:inputText id="firstname" label="#{appMsg['driver.firstname']}" value="#{driverHome.driver.firstname}"
			required="true">
		</p:inputText>
		<h:outputLabel value="#{appMsg['driver.lastname']}" />
		<p:inputText id="lastname" label="#{appMsg['driver.lastname']}" value="#{driverHome.driver.lastname}"
			required="true">
		</p:inputText>
		<h:outputLabel value="#{appMsg['driver.age']}" />
		<p:inputText id="age" label="#{appMsg['driver.age']}" value="#{driverHome.driver.age}" required="true"
			validator="#{driverHome.validateAge}">
			<p:ajax />
		</p:inputText>
		<h:outputLabel value="#{appMsg['driver.birthdate']}" />

		<p:calendar id="birthdate" pattern="dd/MM/yyyy" label="#{appMsg['driver.birthdate']}"
			value="#{driverHome.driver.birthdate}" required="true" navigator="true" display="inline">
		</p:calendar>

		<h:outputLabel value="#{appMsg['driver.level']}" />
		<p:selectOneMenu id="level" value="#{driverHome.driver.level}">
			<f:selectItem itemValue="" itemLabel="" />
			<f:selectItems value="#{levels.list}" var="w" itemValue="#{w}" itemLabel="#{w.name}" itemKey="#{w.id}" />
			<f:converter converterId="twork.ObjectConverter" />
		</p:selectOneMenu>

		<h:outputLabel value="#{appMsg['driver.team']}" />
		<p:selectOneMenu id="team" value="#{driverHome.driver.team}">
			<!-- does not work with PF 3.4.1 f:selectItem noSelectionOption="true" itemLabel="" / -->
			<f:selectItem itemValue="" itemLabel="" />
			<f:selectItems value="#{teams.list}" var="w" itemValue="#{w}" itemLabel="#{w.name}" itemKey="#{w.id}" />
			<tw:objectConverter />
		</p:selectOneMenu>

	</h:panelGrid>

</ui:composition>
</html>
